package com.crazyhat.crazyhat.pojo;

import com.crazyhat.crazyhat.anno.SensitiveWordAnno;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class UserRegistrationRequest {

    @Email
    @NotEmpty
    private String email;

    @NotEmpty
    @Size(min = 6,max = 20, message = "密码长度应在6至20位之间")
    @Pattern(regexp = "^[a-zA-Z0-9@._]+$", message = "密码只能包含字母、数字、@、.、_")
    private String password;

    @SensitiveWordAnno
    @NotEmpty
    @Size(min = 2, max = 30, message = "用户名长度应在2至30位之间")
    private String name;

    @NotEmpty(message = "学号不能为空")
    @Pattern(regexp = "\\d{8}", message = "学号必须为8位")
    private String studentId;

    @NotEmpty
    private String verificationCode;
}
